GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

loading-indication.js ➔ showSubmitIndicators   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
c 3
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
(function ($, app) {
2
    'use strict';
3
4
    $(document)
5
        .on('pjax:send', showLoadingIndicators)
6
        .on('pjax:error', hideLoadingIndicators)
7
        .on('pjax:complete', hideLoadingIndicators)
8
        .on('submit', showSubmitIndicators);
9
10
    function showLoadingIndicators(event) {
11
        if (event.isDefaultPrevented()) {
12
            return;
13
        }
14
        var target = $(event.target).data('pjax-container');
15
16
        if (target == app.ROOT_CONTAINER_NAME) {
17
            $('#ajax-loading').fadeIn(1000);
18
        } else {
19
            var loading = $('<div class="contentLoading"><div class="img"></div></div>');
20
            loading.hide();
21
            $(event.target).css('position', 'relative');
22
            $(event.target).append(loading);
23
            loading.fadeIn(500);
24
        }
25
    }
26
27
    function hideLoadingIndicators(event) {
0 ignored issues
show
Unused Code introduced by
The parameter event is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
28
        $('#ajax-loading').fadeOut(100);
29
        $('.contentLoading').fadeOut(100);
30
        $(document).find('button[data-loading-text]').button('reset');
31
    }
32
33
    function showSubmitIndicators(event) {
0 ignored issues
show
Unused Code introduced by
The parameter event is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
34
        $form.find('button[data-loading-text]').button('loading');
0 ignored issues
show
Bug introduced by
The variable $form seems to be never declared. If this is a global, consider adding a /** global: $form */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
35
    }
36
})(jQuery, application);
0 ignored issues
show
Bug introduced by
The variable application seems to be never declared. If this is a global, consider adding a /** global: application */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
37